package demo

import org.apache.lucene.demo.facet.AssociationsFacetsExample

private val example = AssociationsFacetsExample()

fun main() {
  println("Sum associations example:")
  //    runSumAssociations()
  runDrillDown()
}

fun runSumAssociations() {
  example.runSumAssociations().forEach { facetResult ->
    println("-------------------------")
    println(facetResult.dim)
    println(facetResult.path.joinToString(","))
    println(facetResult.value)
    println(facetResult.childCount)
    facetResult.labelValues.forEach { println("${it.label}: ${it.value}") }
  }
}

fun runDrillDown() {
  val facetResult = example.runDrillDown()
  println("-------------------------")
  println(facetResult.dim)
  println(facetResult.path.joinToString(","))
  println(facetResult.value)
  println(facetResult.childCount)
  facetResult.labelValues.forEach { println("${it.label}: ${it.value}") }
}
